package com.itlong.cloud.enumerate;

/**
 * <desc>
 *      产品类型枚举
 * </desc>
 *
 * @createDate 2021/2/21
 **/
public enum ProductModelTypeEnum {

    CLOUD_ELEVATOR("0", "云电梯"),
    CLOUD_INTERCOM("1", "云对讲"),
    CLOUD_ENTRANCE("2", "云门禁"),
    CLOUD_CONTROLLER("3","群控器"),
    CLOUD_WIPPEN_DEVICE("4","联动器"),
    FACE_PAD("5","人脸识别仪"),
    CLOUD_UNIBODY_FACE_DEVICE("6","一体式人脸识别门禁");

    //产品类型
    private String type;
    //产品类型的名称
    private String name;

    ProductModelTypeEnum(String type, String name){
        this.type = type;
        this.name = name;
    }

    /**
     * <desc>
     *      通过产品类型id获取产品类型名称
     * </desc>
     *
     * @param type
     * @return
     * @Author Zhu.yj
     * @createDate  2021/2/21
     */
    public static String getNameByType(String type){
        if (type == null){
            return "";
        }
        for (ProductModelTypeEnum feeTypeEnum : values()){
            if (feeTypeEnum.type.equals(type)){
                return feeTypeEnum.name;
            }
        }
        return "";
    }
}
